home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trading on the Edge
/
Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin
/
pc
/
mac_file
/
vendor_d
/
neuralwa
/
nw2v50
/
sommap.nnc
< prev
next >
Wrap
Text File
|
1993-08-23
|
2KB
|
76 lines
csv3.8 ! Control Strategy Version 3.8
!************************************************************************
!* *
!* 2D Self-Organizing Map with mapping *
!* *
!* Assumes: Input Layer *
!* 2-D Kohonen Layer *
!* Optional Hidden layers *
!* Output Layer *
!* *
!************************************************************************
!
! *** Recall ***
!
!MASK label op-code operands comment
L_saR_sa trace aux3 ! set trace option to aux3
L_saR_sa cset recall,1 ! recall count
!
L___R_sa lset in ! input layer
L___R_sa io read ! get input data
L___R_sa math sum|rnoise|tran|output ! result of input layer
L___R_sa lset cur,1 ! next layer, 2D Kohonen layer
L___R_sa math sum|tran|output|fire ! get min euclid dist
! Now do hidden and output layers
L___R_sa @rloop lset cur,1 ! next layer
L___R_sa math sum|fire
L___R_sa math rnoise|tran|output|e=0
L___R_sa lcmp out ! at output layer ?
L___R_sa blt @rloop ! loop till at output layer
L___R_sa io write ! write out result
L___R_sa io rcltst ! read in desired
L___R_sa math ce=e|e-=w|swap|fire
L___R_sa brct @exit ! skip to end
! *** Learning ***
!
L_saR___ lset in ! start at input layer
L_saR___ io lrnin ! get input data
L_saR___ math sum|lnoise|tran|output ! result of input layer
L_saR___ lset cur, 1 ! 2D Kohonen layer
L_saR___ math sum|output|fire ! sum does Euclidean distance,
! sum with bias put in tran fld.
L_saR___ math learn|fire ! update wts & freq
! Now do hidden and output layers
L_saR___ cset wrk2,0
L_saR___ @lloop lset cur,1
L_saR___ cadd wrk2,1 !Count number hidden/output layers
L_saR___ math sum|fire
L_saR___ math lnoise|tran|output|e=0|fire
L_saR___ lcmp out
L_saR___ blt lloop
! Now we are at the output layer. Read in the desired output and
! do back-prop learning down to the kohonen layer
L_saR___ io lrnrslt ! result of feed-forward
L_saR___ io lrnout ! desired output
L_saR___ math e-=w|e*=ef|fire !calculate error,scale with errfac
L_saR___ @bloop math ce=e|e*=f'|backp|fire
L_saR___ math learn|fire ! delayed learning for recurrence
L_saR___ lset cur,-1 ! previous layer
L_saR___ csub wrk2,1 ! Don't go below hidden
L_saR___ ccmp wrk2,0
L_saR___ bgt @bloop
!
LisaRisa @exit trace 0 ! turn off any trace function